import request from '@/utils/request'

const api_name = 'system/file'

export default {
    getPageList(page, pageSize, searchObj) {
        return request({
            url: `${api_name}/${page}/${pageSize}`,
            method: 'get',
            params: searchObj
        })
    },
    save(file) {
        return request({
            url: `${api_name}/save`,
            method: 'post',
            data: file
        })
    },
    update(file) {
        return request({
            url: `${api_name}/update`,
            method: 'post',
            data: file
        })
    },
    removeById(id) {
        return request({
            url: `${api_name}/${id}`,
            method: 'delete'
        })
    },
    getUserId(id) {
        return request({
            url: `${api_name}/${id}`,
            method: 'get'
        })
    },
    getByFolder(id) {
        return request({
            url: `${api_name}/folder/${id}`,
            method: 'get'
        })
    },
    getBin() {
        return request({
            url: `${api_name}/bin`,
            method: 'get'
        })
    },
    recover(file) {
        return request({
            url: `${api_name}/bin`,
            method: 'post',
            data: file
        })
    }
}